import { request } from '@/utils/request.js'

/**
 * 供应商渠道 API JS
 */

export default {

  /**
   * 获取供应商渠道列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'logistics/supplierChannel/index',
      method: 'get',
      params
    })
  },

  /**
    * 获取供应商渠道选择树
    * @returns
    */
  tree () {
    return request({
      url: 'logistics/supplierChannel/tree',
      method: 'get'
    })
  },
  pull (data = {}) {
    return request({
      url: 'logistics/supplierChannel/pull',
      method: 'post',
      data
    })
  },


  /**
   * 添加供应商渠道
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'logistics/supplierChannel/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新供应商渠道数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'logistics/supplierChannel/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取供应商渠道
   * @returns
   */
  read (id) {
    return request({
      url: 'logistics/supplierChannel/read/' + id,
      method: 'get'
    })
  },

  /**
   * 将供应商渠道删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'logistics/supplierChannel/delete',
      method: 'delete',
      data
    })
  },
  
  setStatus (data = {}) {
    return request({
      url: 'logistics/supplierChannel/setStatus',
      method: 'put',
      data
    })
  },  

}